<?php

namespace App\Http\Controllers;

use App\Tags;
use Illuminate\Http\Request;

use App\Http\Requests;

class TagsController extends Controller
{
    public function list()
    {
        $tags = Tags::all();

        return response()->json($tags);
    }

    public function add(Request $request)
    {
        $this->validate($request, [
            'tag' => 'required|max:255',
        ]);

        $tags= Tags::create(["label"=>$request->get('tag')]);
    }

}
